// Unless explicitly stated otherwise all files in this repository are licensed
// under the MIT License.
// This product includes software developed at Guance Cloud (https://www.guance.com/).
// Copyright 2021-present Guance, Inc.

package influxdb

var MetricMap = map[string]map[string]string{
	"memstats": {
		"Alloc":         "alloc",
		"TotalAlloc":    "total_alloc",
		"Sys":           "sys",
		"Lookups":       "lookups",
		"Mallocs":       "mallocs",
		"Frees":         "frees",
		"HeapAlloc":     "heap_alloc",
		"HeapSys":       "heap_sys",
		"HeapIdle":      "heap_idle",
		"HeapInuse":     "heap_inuse",
		"HeapReleased":  "heap_released",
		"HeapObjects":   "heap_objects",
		"StackInuse":    "stack_inuse",
		"StackSys":      "stack_sys",
		"MSpanInuse":    "mspan_inuse",
		"MSpanSys":      "mspan_sys",
		"MCacheInuse":   "mcache_inuse",
		"MCacheSys":     "mcache_sys",
		"BuckHashSys":   "buck_hash_sys",
		"GCSys":         "gc_sys",
		"OtherSys":      "other_sys",
		"NextGC":        "next_gc",
		"LastGC":        "last_gc",
		"PauseTotalNs":  "pause_total_ns",
		"PauseNs":       "pause_ns",
		"NumGC":         "num_gc",
		"NumForcedGC":   "num_forced_gc",
		"GCCPUFraction": "gc_cpu_fraction",
	},
	"runtime": {
		"Alloc":        "alloc",
		"Frees":        "frees",
		"HeapAlloc":    "heap_alloc",
		"HeapIdle":     "heap_idle",
		"HeapInUse":    "heap_inuse",
		"HeapObjects":  "heap_objects",
		"HeapReleased": "heap_released",
		"HeapSys":      "heap_sys",
		"Lookups":      "lookups",
		"Mallocs":      "mallocs",
		"NumGC":        "num_gc",
		"NumGoroutine": "num_goroutine",
		"PauseTotalNs": "pause_total_ns",
		"Sys":          "sys",
		"TotalAlloc":   "total_alloc",
	},
	"queryExecutor": {
		"queriesActive":   "queries_active",
		"queriesExecuted": "queries_executed",
		"queriesFinished": "queries_finished",
		"queryDurationNs": "query_duration_ns",
		"recoveredPanics": "recovered_panics",
	},
	"database": {
		"numMeasurements": "num_measurements",
		"numSeries":       "num_series",
	},
	"shard": {
		"diskBytes":          "disk_bytes",
		"fieldsCreate":       "fields_create",
		"seriesCreate":       "series_create",
		"writeBytes":         "write_bytes",
		"writePointsDropped": "write_points_dropped",
		"writePointsErr":     "write_points_err",
		"writePointsOk":      "write_points_ok",
		"writeReq":           "write_req",
		"writeReqErr":        "write_req_err",
		"writeReqOk":         "write_req_ok",
		"writeValuesOk":      "write_values_ok",
	},
	"tsm1_engine": {
		"cacheCompactionDuration":       "cache_compaction_duration",
		"cacheCompactionErr":            "cache_compaction_err",
		"cacheCompactions":              "cache_compactions",
		"cacheCompactionsActive":        "cache_compactions_active",
		"tsmFullCompactionDuration":     "tsm_full_compaction_duration",
		"tsmFullCompactionErr":          "tsm_full_compaction_err",
		"tsmFullCompactionQueue":        "tsm_full_compaction_queue",
		"tsmFullCompactions":            "tsm_full_compactions",
		"tsmFullCompactionsActive":      "tsm_full_compactions_active",
		"tsmLevel1CompactionDuration":   "tsm_level1_compaction_duration",
		"tsmLevel1CompactionErr":        "tsm_level1_compaction_err",
		"tsmLevel1CompactionQueue":      "tsm_level1_compaction_queue",
		"tsmLevel1Compactions":          "tsm_level1_compactions",
		"tsmLevel1CompactionsActive":    "tsm_level1_compactions_active",
		"tsmLevel2CompactionDuration":   "tsm_level2_compaction_duration",
		"tsmLevel2CompactionErr":        "tsm_level2_compaction_err",
		"tsmLevel2CompactionQueue":      "tsm_level2_compaction_queue",
		"tsmLevel2Compactions":          "tsm_level2_compactions",
		"tsmLevel2CompactionsActive":    "tsm_level2_compactions_active",
		"tsmLevel3CompactionDuration":   "tsm_level3_compaction_duration",
		"tsmLevel3CompactionErr":        "tsm_level3_compaction_err",
		"tsmLevel3CompactionQueue":      "tsm_level3_compaction_queue",
		"tsmLevel3Compactions":          "tsm_level3_compactions",
		"tsmLevel3CompactionsActive":    "tsm_level3_compactions_active",
		"tsmOptimizeCompactionDuration": "tsm_optimize_compaction_duration",
		"tsmOptimizeCompactionErr":      "tsm_optimize_compaction_err",
		"tsmOptimizeCompactionQueue":    "tsm_optimize_compaction_queue",
		"tsmOptimizeCompactions":        "tsm_optimize_compactions",
		"tsmOptimizeCompactionsActive":  "tsm_optimize_compactions_active",
	},
	"tsm1_cache": {
		"WALCompactionTimeMs": "wal_compaction_time_ms",
		"cacheAgeMs":          "cache_age_ms",
		"cachedBytes":         "cached_bytes",
		"diskBytes":           "disk_bytes",
		"memBytes":            "mem_bytes",
		"snapshotCount":       "snapshot_count",
		"writeDropped":        "write_dropped",
		"writeErr":            "write_err",
		"writeOk":             "write_ok",
	},
	"tsm1_filestore": {
		"diskBytes": "disk_bytes",
		"numFiles":  "num_files",
	},
	"tsm1_wal": {
		"currentSegmentDiskBytes": "current_segment_disk_bytes",
		"oldSegmentsDiskBytes":    "old_segments_disk_bytes",
		"writeErr":                "write_err",
		"writeOk":                 "write_ok",
	},
	"write": {
		"pointReq":      "point_req",
		"pointReqLocal": "point_req_local",
		"req":           "req",
		"subWriteDrop":  "sub_write_drop",
		"subWriteOk":    "sub_write_ok",
		"writeDrop":     "write_drop",
		"writeError":    "write_error",
		"writeOk":       "write_ok",
		"writeTimeout":  "write_timeout",
	},
	"subscriber": {
		"createFailures": "create_failures",
		"pointsWritten":  "points_written",
		"writeFailures":  "write_failures",
	},
	"cq": {
		"queryFail": "query_fail",
		"queryOk":   "query_ok",
	},
	"httpd": {
		"authFail":               "auth_fail",
		"clientError":            "client_error",
		"fluxQueryReq":           "flux_query_req",
		"fluxQueryReqDurationNs": "flux_query_req_duration_ns",
		"pingReq":                "ping_req",
		"pointsWrittenDropped":   "points_written_dropped",
		"pointsWrittenFail":      "points_written_fail",
		"pointsWrittenOK":        "points_written_ok",
		"promReadReq":            "prom_read_req",
		"promWriteReq":           "prom_write_req",
		"queryReq":               "query_req",
		"queryReqDurationNs":     "query_req_duration_ns",
		"queryRespBytes":         "query_resp_bytes",
		"recoveredPanics":        "recovered_panics",
		"req":                    "req",
		"reqActive":              "req_active",
		"reqDurationNs":          "req_duration_ns",
		"serverError":            "server_error",
		"statusReq":              "status_req",
		"valuesWrittenOK":        "values_written_ok",
		"writeReq":               "write_req",
		"writeReqActive":         "write_req_active",
		"writeReqBytes":          "write_req_bytes",
		"writeReqDurationNs":     "write_req_duration_ns",
	},
}
